﻿package 
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import src.hardware.MeggyJrRGB;
	import com.hexagonstar.util.debug.Debug;
	import src.interfaces.IMeggyJrRGB;
	import src.software.MarqueeTest;
	import src.software.MeggyJr_RandomColors;
	
	public class Main extends Sprite
	{
		[Embed(source="art/meggyjr.png")]
        public var meggyJrBackground:Class;
		
		public static const EMULATOR_COLOR_RESTRICTION:Boolean = true;
		
		
		private var hardware:IMeggyJrRGB;
		
		public function Main():void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			Debug.clear();
			
			stage.frameRate = 30;
			
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			hardware = new MeggyJrRGB();
			
			var background:DisplayObject = new meggyJrBackground() as DisplayObject;
			background.scaleX = .5;
			background.scaleY = .5;
			addChild(background);
			addChild(hardware as DisplayObject);
			
			var test:MeggyJr_RandomColors = new MeggyJr_RandomColors(hardware);
			addChild(test);
		}

	}
}